package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.ExecutionPageQueryDTO;
import com.sky.entity.Execution;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ExecutionMapper {

    Page<Execution> pageQuery(ExecutionPageQueryDTO pageQuery);

    @AutoFill(value = OperationType.UPDATE)
    void update(Execution execution);

    void deleteBatch(List<Long> ids);

    @Select("insert into execution (id,violation_id,type,violation_type,image_path,location,status,create_time,file,detail,user_id) " +
            "values (#{id},#{violationId},#{type},#{violationType},#{imagePath},#{location},#{status},#{createTime},#{file},#{detail},#{userId})")
    void insert(Execution execution);

}
